@page
@model OutsideAdminDemoModel
@using Microsoft.AspNetCore.Mvc.RazorPages
@using OrchardCore.Admin;

@functions
{
    [Admin]
    public class OutsideAdminDemoModel : PageModel
    {
        public string Title { get; set; }
        public string Message { get; private set; }

        public void OnGet()
        {
            Title = "This is an Admin RazorPage coming from OrchardCore.Demo!";
            Message = $"Date and time on the server: { DateTime.Now.ToString() }";
        }
    }
}

@await Html.PartialAsync("Header", Model)

<h1>@Model.Title</h1>
<h2>Hello from @ViewContext.RouteData.Values["page"]</h2>

<p>
    I am not under an '/Admin/' folder but I am a protected Admin Page as my model is decorated with the '[Admin]' attribute.
</p>
<p>
    Being an Admin Page my default path based route is automatically prefixed with the current 'AdminOptions.AdminUrlPrefix'.
</p>
<p>
    @T[Model.Message]
</p>
<p>
    Date using the DateTimeShape: @await DisplayAsync(await New.DateTime(Utc: null, Format: T["MMMM dd, yyyy"].Value))
</p>
